package com.rdc.qingkou.presenter;


import com.rdc.qingkou.base.BasePresenterImpl;
import com.rdc.qingkou.model.HomepageModel;
import com.rdc.qingkou.model.imodel.IHomepageModel;
import com.rdc.qingkou.presenter.ipresenter.IHomepagePresenter;
import com.rdc.qingkou.ui.iview.IHomepageView;
import com.rdc.qingkou.vo.CardVO;

import java.util.List;

public class HomepagePresenter extends BasePresenterImpl<IHomepageView> implements IHomepagePresenter {

    private IHomepageModel model;

    public HomepagePresenter() {
        model = new HomepageModel(this);
    }

    @Override
    public void sendRequest() {
        model.sendRequest();
    }

    @Override
    public void RequestSuccess(List<String> tabList, List<CardVO> cardList) {
        if (isAttachView()) {
            getMvpView().setTabsName(tabList);
            getMvpView().setCard(cardList);
        }
    }

    @Override
    public void RequestError(String message) {
        if (isAttachView()) {
            getMvpView().getCardError(message);
        }
    }


    @Override
    public void clearDisposable() {
        model.clearDisposable();
    }

}
